using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kimgwajang.MidnightPeach.Schema
{
    [Serializable]
    public class Column : SchemaElement
    {
        public Column(Table table, string name)
            : base(name)
        {
            Table = table;
            Table.Columns.Add(this);
        }

        public Table Table { get; set; }

        public string DbName { get; set; }

        public string Type { get; set; }

        public string DbType { get; set; }

        public bool PrimaryKey { get; set; }

        public bool DbGenerated { get; set; }

        public bool Nullable { get; set; }

        public bool ReadOnly { get; set; }
        
        public bool Identity { get; set; }

        public override string ToString()
        {
            return Name + "\t" + Type + "\t" + DbType + "\t" + PrimaryKey + "\t" + DbGenerated + "\t" + Nullable;
        }
    }
}